/*
 * Powered By cuichen
 * Since 2014 - 2018
 */package com.seeyoui.kensite.bussiness.orderlang.inboundProduct.service;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.seeyoui.kensite.common.base.service.BaseService;

import java.util.*;

import com.seeyoui.kensite.common.base.domain.EasyUIDataGrid;
import com.seeyoui.kensite.common.base.service.BaseService;
import com.seeyoui.kensite.common.exception.CRUDException;
import com.seeyoui.kensite.common.util.*;
import com.seeyoui.kensite.common.constants.StringConstant;
import com.seeyoui.kensite.bussiness.orderlang.inboundProduct.domain.InboundProduct;
import com.seeyoui.kensite.bussiness.orderlang.inboundProduct.persistence.InboundProductMapper;

/**
 * InboundProduct
 * @author cuichen
 * @version 2.0
 * @since 1.0
 * @date 2018-02-27
 */

@Service
public class InboundProductService extends BaseService {
	
	@Autowired
	private InboundProductMapper inboundProductMapper;

	/**
	 * 根据ID查询单条数据
	 * @param id
	 * @return
	 * @throws CRUDException
	 */
	public InboundProduct findOne(String id) throws CRUDException{
		return inboundProductMapper.findOne(id);
	}
	
	/**
	 * 查询数据集合
	 * @param inboundProduct
	 * @return
	 * @throws CRUDException
	 */
	public List<InboundProduct> findList(InboundProduct inboundProduct) throws CRUDException {
		return inboundProductMapper.findList(inboundProduct);
	}
	
	/**
	 * 查询所有数据集合
	 * @param inboundProduct
	 * @return
	 * @throws CRUDException
	 */
	public List<InboundProduct> findAll(InboundProduct inboundProduct) throws CRUDException {
		return inboundProductMapper.findAll(inboundProduct);
	}
	
	/**
	 * 查询数据总数
	 * @param inboundProduct
	 * @return
	 * @throws CRUDException
	 */
	public int findTotal(InboundProduct inboundProduct) throws CRUDException {
		return inboundProductMapper.findTotal(inboundProduct);
	}
	
	/**
	 * 查询数据总数排除当前数据
	 * @param inboundProduct
	 * @return
	 * @throws CRUDException
	 */
	public int findExTotal(InboundProduct inboundProduct) throws CRUDException {
		return inboundProductMapper.findExTotal(inboundProduct);
	}
	
	/**
	 * 数据新增
	 * @param inboundProduct
	 * @throws CRUDException
	 */
	public void save(InboundProduct inboundProduct) throws CRUDException{
		inboundProduct.preInsert();
		inboundProductMapper.save(inboundProduct);
	}
	
	/**
	 * 数据修改
	 * @param inboundProduct
	 * @throws CRUDException
	 */
	public void update(InboundProduct inboundProduct) throws CRUDException{
		inboundProduct.preUpdate();
		inboundProductMapper.update(inboundProduct);			
	}
	
	/**
	 * 数据删除
	 * @param listId
	 * @throws CRUDException
	 */
	public void delete(List<String> listId) throws CRUDException {
		inboundProductMapper.delete(listId);
	}
	
	/**
	 * 数据假删除
	 * @param inboundProduct
	 * @throws CRUDException
	 */
	public void remove(InboundProduct inboundProduct) throws CRUDException{
		inboundProduct.preUpdate();
		inboundProductMapper.remove(inboundProduct);			
	}
	
}